using System.Collections;
using System.Collections.Generic;
using System.ServiceModel;

namespace NHServices.Core
{
    [ServiceContract]
    public interface IGenericService<T,Id>
    {
        [UseNetDataContractSerializer]
        [OperationContract]
        T FindByid(Id id);

        [UseNetDataContractSerializer]
        [OperationContract]
        IList<T> FindAll();

        [UseNetDataContractSerializer]
        [OperationContract]
        [TransactionFlow(TransactionFlowOption.Allowed)]
        T Save(T entity);

        [UseNetDataContractSerializer]
        [OperationContract]
        [TransactionFlow(TransactionFlowOption.Allowed)]
        T Update(T entity);

        [UseNetDataContractSerializer]
        [OperationContract]
        [TransactionFlow(TransactionFlowOption.Allowed)]
        int DeleteById(Id id);

        [UseNetDataContractSerializer]
        [OperationContract]
        [TransactionFlow(TransactionFlowOption.Allowed)]
        int Delete(T entity);
    }
}